Skip to main content

Secure JDBC Password

Follow Below Steps to secure JDBC Password

Here you will learn, How to secure JDBC password in tomcat context.xml file.

Download SecureTomcatJDBC.jar file from link given below;

SecureTomcatJDBC.zip

Open CMD > change the file path where SecureTomcat.jar is located > run jar with this given command; Java -jar SecureTomcatJDBC.jar “Your password text” (it’ll generate Hash password copy that hash string.)

Docusaurus Slash Introduction

open the given path: C:\apache-tomcat\webapps\aiv\META-INF and open context.xml in any text editor. here it’ll look like.

Docusaurus Slash Introduction

Replace the plain password text with encrypted password. Add one more property : factory="SecureTomcatDataSourceImpl" (replace with this value if it’s already exist.)after making this change context file will look like :

Docusaurus Slash Introduction

Copy the SecureTomcatJDBC.jar in to tomcat/lib

Start/Restart the server. Note:You need to generate encrypted password for both SQL & AIV Login and update in context.xml file.

context(Before%20Changes).zip

context(Updated).zip